/**
 * 
 */
package com.hera.base.web.primefaces.push;

import java.io.Serializable;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;

import org.primefaces.push.EventBus;
import org.primefaces.push.EventBusFactory;


/**
 * @author cmontes
 *
 */
@ManagedBean
@ApplicationScoped
public class PushNotifierView implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3468796498690698166L;

	private final static String CHANNEL = "/{inbox}/";
	
	private final EventBus eventBus = EventBusFactory.getDefault().eventBus();
	
	public void send() {
		System.out.println("enviandoo......... ");
        eventBus.publish(CHANNEL, new FacesMessage("titulo", "detalle...."));
    }

}
